import cv2
import numpy as np
img_path='traffic.png'
img=cv2.imread(img_path)
cv2.imshow("Input",img)
imgContour=img.copy()
imgGray=cv2.cvtColor(img,cv2.COLOR_RGB2GRAY)
imgBlur=cv2.GaussianBlur(imgGray,(5,5),1)
cv2.imshow("Blur",imgBlur)
cv2.waitKey()
cv2.destroyAllWindows()

imgCanny=cv2.Canny(imgBlur,70,200)
cv2.imshow("Canny",imgCanny)
contours,hierarchy=cv2.findContours(imgCanny,cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_NONE)
imgContour=cv2.drawContours(imgContour,contours,-1,(0,255,255),2)
cv2.imshow("Contours",imgContour)

